export default function generateMarkerContent(  
    title: string, // 新增 title 参数  
    name: string,  
    note?: string,  
    img?: string,  
    type?: string,  
    index?: number  
) {  
    const indexClass = isNaN(Number(index)) ? 'hidden' : '';  
    const indexContent = index >= 0 ? `${index + 1}` : '';  

    // 基础的 marker 结构  
    const markerBase = `  
        <div class="marker ${type}">  
            <div class="marker-index">  
                <div class="index ${indexClass}">${indexContent}</div>  
                <div class="title">${title}</div> <!-- 使用传入的 title -->  
            </div>  
    `;  

    // 根据不同的条件构建内容  
    let content = '';  

    if (img && note) {  
        content = `  
            <div class="marker-content">  
                <div class="note">${note.replace(/\n/g, '<br>')}</div>  
                <div class="view">  
                    <a target="_blank" href="${img + '-' + thumbnail1500_suffix}">  
                        <img src="${img + '-' + thumbnail1000_suffix}" alt="view">  
                    </a>  
                </div>  
            </div>  
        `;  
    } else if (img) {  
        content = `  
            <div class="marker-content">  
                <div class="view">  
                    <a target="_blank" href="${img + '-' + thumbnail1500_suffix}">  
                        <img src="${img + '-' + thumbnail1000_suffix}" alt="view">  
                    </a>  
                </div>  
            </div>  
        `;  
    } else if (note) {  
        content = `  
            <div class="marker-content">  
                <div class="note">${note.replace(/\n/g, '<br>')}</div>  
            </div>  
        `;  
    }  

    // 返回完整的 marker 内容  
    return markerBase + content + '</div>'; // 关闭 marker 的 div  
}